package com.monkeyboy.spring.myimport;

import org.springframework.beans.factory.Aware;
import org.springframework.beans.factory.support.BeanDefinitionRegistry;
import org.springframework.beans.factory.support.BeanNameGenerator;
import org.springframework.context.ResourceLoaderAware;
import org.springframework.context.annotation.ImportBeanDefinitionRegistrar;
import org.springframework.context.annotation.ImportSelector;
import org.springframework.core.io.ResourceLoader;
import org.springframework.core.type.AnnotationMetadata;

/**
 * @Author Gavin
 * @date 2021.03.26 10:36
 */
public class MyImport implements ImportSelector, ImportBeanDefinitionRegistrar , ResourceLoaderAware {
	@Override
	public void registerBeanDefinitions(AnnotationMetadata importingClassMetadata, BeanDefinitionRegistry registry, BeanNameGenerator importBeanNameGenerator) {
		System.out.println("-------------ImportBeanDefinitionRegistrar-----------");
	}

	@Override
	public void setResourceLoader(ResourceLoader resourceLoader) {
		System.out.println(">>>>>>>>>>>>>>Aware>>>>>>>>>>>>>>");
	}

	@Override
	public String[] selectImports(AnnotationMetadata importingClassMetadata) {
		return new String[]{"com.monkeyboy.spring.model.User"};
	}
}
